package edu.westga.movierec.model;
import java.sql.SQLException;

import edu.westga.movierec.model.XamppDBConnector;
/**
 * This class creates a recommendation from 
 * a user's choices, based on a database.
 * 
 * @author jmcook
 *
 */
public class Recommender {
	private XamppDBConnector theDatabase;
	
	/*Methods to add:
		constructor
		recommend (get movie)
		respond (add or subtract from ratings)
		resetUser (delete users history)
		addmovie? (for later iteration)
	*/
	/**
	 * Creates a new instance of the recommender that
	 * will gets its data from a XamppDBConnector
	 * <p>
	 * Precondition: None
	 * <p>
	 * Postcondition: isDatabaseOpen() == true
	 */
	public Recommender(){
		theDatabase = new XamppDBConnector();
	}
	/**
	 * Checks if the database connected
	 * 
	 * @return true if database connected and is working
	 */
	public boolean isDatabaseOpen(){
			if(this.theDatabase.isConnectionOpen())
			{
				return true;
			}
			return false;
	}

}
